#ifndef GAMEDATA_H
#define GAMEDATA_H

#include <QObject>
#include <QDeclarativeListProperty>
#include "cake.h"

class GameData : public QObject
{
    Q_OBJECT
public:
    GameData(QObject *parent = 0);
    ~GameData();

//    Q_PROPERTY(QString gameTime READ gameTime WRITE setGameTime NOTIFY gameTimeChanged);
//    QString gameTime() const {return m_time;}
//    void setGameTime(const QString &time) {if(time==m_time) return; m_time = time; emit gameTimeChanged();}

//    Q_PROPERTY(bool gameOn READ gameOn WRITE setGameOn NOTIFY gameOnChanged);
//    bool gameOn() const {return m_gameOn;}
//    void setGameOn(bool on) {if(on==m_gameOn) return; m_gameOn = on; emit gameOnChanged();}

    Q_PROPERTY(QDeclarativeListProperty<Cake> cakes READ cakes CONSTANT);
    QDeclarativeListProperty<Cake> cakes() {return QDeclarativeListProperty<Cake>(this, m_cakes);}

signals:
//    void gameTimeChanged();
//    void gameOnChanged();

private:
    Cake *cake(int index) const {return (index >= 0 && index < m_cakes.count()) ? m_cakes.at(index) : 0;}
    QList<Cake *> m_cakes;
//    bool m_gameOn;
//    int m_gameTimeSeconds;
//    QTime m_gameTime;
//    QTimer *m_gameTimer;
//    QString m_time;

public slots:
//    void updateTime();
//    void pauseGame(bool state);
};

#endif // GAMEDATA_H
